package com.qumitech.visualnovel.controller.rest;


import com.qumitech.visualnovel.model.common.BaseRsp;
import com.qumitech.visualnovel.model.common.ResultEnum;
import com.qumitech.visualnovel.pubdef.dto.openplatform.KuaiShouQueryDTO;
import com.qumitech.visualnovel.pubdef.dto.openplatform.TouTiaoQueryDTO;
import com.qumitech.visualnovel.service.openplatform.OpenPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class OpenPlatformController {

    @Autowired
    OpenPlatformService openPlatformService;

    @GetMapping(value = "/ks")
    public BaseRsp getKuaiShouAppInfo(KuaiShouQueryDTO queryDTO) {
        openPlatformService.pushKuaiShouInfoToServer(queryDTO);
        return new BaseRsp(ResultEnum.SUCCESS);
    }

    @GetMapping(value = "/toutiao")
    public BaseRsp getTouTiaoAppInfo(TouTiaoQueryDTO queryDTO) {
        openPlatformService.pushTouTiaoInfoToServer(queryDTO);
        return new BaseRsp(ResultEnum.SUCCESS);
    }
}
